How to get selected item from Dropdown in GridView

63

How to get selected item from Dropdown in GridView -

protected void LinkButton1_Click(object sender, EventArgs e)
{
  LinkButton lnkBtn = (LinkButton)sender;
  GridViewRow row = (GridViewRow)lnkBtn.NamingContainer;
  DropDownList ddl= (DropDownList)row.FindControl("DropDownList1");
  TextBox1.Text = ddl.SelectedValue.ToString();
}

Comments

Submit
0 Comments